<!--
 * @Author: Chenqiu
 * @Date: 2021-09-17 14:20:37
 * @LastEditors: Chenqiu
 * @LastEditTime: 2021-09-23 19:25:09
 * @Description: 
-->
<template>
  <div>
    <!-- 底部 -->
    <div class="footer">
      <div class="wrapper">
        <div class="message">
          <div class="school">
            {{ school }}
          </div>
          <div class="emailCode">邮编：{{ emailCode }}</div>
          <div class="address">地址：{{ address }}</div>
          <div class="phoneNumber">联系电话：{{ phoneNumber }}</div>
          <div class="mailBox">管理员邮箱：{{ mailBox }}</div>
          <div class="copyright">
            版权所有：河西学院
            陇ICP备05000590号&nbsp;&nbsp;甘公网安备&nbsp;&nbsp;62070202000460
          </div>
        </div>
        <div class="message_img">
          <div class="ewm_img">
            <img class="wximg" src="../assets/resource/img/wxewm.jpg" alt="" />
            <img class="dyimg" src="../assets/resource/img/dyewm.jpg" alt="" />
          </div>
        </div>
      </div>
    </div>
    <!-- /底部 -->
  </div>
</template>
<script>
import { get } from "../utils/request";

export default {
  data() {
    return {
      address: "",
      emailCode: "",
      school: "",
      phoneNumber: "",
      mailBox: "",
    };
  },
  created() {
    this.loadAddress();
    this.loademailCode();
    this.loadSchool();
    this.loadPhoneNumber();
    this.loadMailBox();
  },
  methods: {
    // 加载地址
    loadAddress() {
      let url = "/index/findByKey";
      get(url, { name: "address" }).then((res) => {
        let data = res.data;
        // 如果地址存在，给我返回
        if (data) {
          this.address = data.val;
        }
      });
    },
    // 加载邮编
    loademailCode() {
      let url = "/index/findByKey";
      get(url, { name: "emailCode" }).then((res) => {
        let data = res.data;
        if (data) {
          this.emailCode = data.val;
        }
      });
    },
    // 加载校区
    loadSchool() {
      let url = "/index/findByKey";
      get(url, { name: "school" }).then((res) => {
        let data = res.data;
        if (data) {
          this.school = data.val;
        }
      });
    },
    // 加载联系电话
    loadPhoneNumber() {
      let url = "/index/findByKey";
      get(url, { name: "phoneNumber" }).then((res) => {
        let data = res.data;
        if (data) {
          this.phoneNumber = data.val;
        }
      });
    },
    // 加载邮箱
    loadMailBox() {
      let url = "/index/findByKey";
      get(url, { name: "mailBox" }).then((res) => {
        let data = res.data;
        if (data) {
          this.mailBox = data.val;
        }
      });
    },
  },
};
</script>

<style lang="scss">
// 底部样式
.footer {
  background-color: #5c5675;
  color: white;
  font-size: 13px;
  line-height: 1.5em;
  padding: 1.5em;
  & > .wrapper::after {
    display: block;
    content: "";
    clear: both;
  }
  .message {
    float: left;
    line-height: 2em;
  }
  .message_img {
    float: right;
    .ewm_img {
      float: right;
      .wximg {
        margin-right: 10px;
      }
    }
  }
}
</style>
